package com.hao.eduservice.client;

import com.hao.commonutils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author chenwenhao
 * @version 1.0.0
 * @ClassName VodClient.java
 * @createTime 2020/12/13,14:01
 * @FeignClient(name = "service-vod") ： 远程服务名
 * fallback = VodFileDegradeFeignClient.class : 调用远程服务失败后，执行的本地方法
 */

@Component
@FeignClient(name = "service-vod", fallback = VodFileDegradeFeignClient.class)
public interface VodClient {

    /**
     * 删除阿里视频
     *
     * @param videoId 视频id
     * @return {@link R}
     * 要调用的vod服务中的方法
     */
    @DeleteMapping("/eduvod/video/{videoId}")
    public R removeAliVideo(@PathVariable("videoId") String videoId);

    /**
     * 删除阿里视频
     *
     * @param videoIds 视频id
     * @return {@link R}
     */
    @DeleteMapping("/eduvod/video/deleteAliVideos")
    public R deleteAliVideos(@RequestParam("videoIds") List<String> videoIds);
}
